import { defineConfig } from '@umijs/max';
import { routes } from './routes';

export default defineConfig({
  antd: {
    // dark: true,
    // 紧凑模式
    // compact: true,
    configProvider: {},
  },
  access: {},
  model: {},
  initialState: {},
  request: {},
  layout: {},
  routes,
  npmClient: 'pnpm',
  define: {
    'process.env.RANDOM_COVER_IMG': process.env.RANDOM_COVER_IMG,
  },
  proxy: {
    '/common': {
      target: process.env.SERVER_IP,
      changeOrigin: true,
      pathRewrite: { '^/common': '' },
    },
    '/randomWords': {
      target: 'https://v1.hitokoto.cn',
      changeOrigin: true,
      pathRewrite: { '^/randomWords': '' },
    },
    '/api': {
      target: process.env.SERVER_IP,
      changeOrigin: true,
    },
  },
});
